home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / GMS / Source / Asm / Screens / HiResScreen.s < prev    next >
Encoding:
Text File  |  1997-05-04  |  2.1 KB  |  97 lines

  1. ;-------T-------T------------------------T---------------------------------;
  2. ;HiRes Interlaced Picture Display
  3. ;--------------------------------
  4. ;Opens a screen in HIRES and LACED modes.  You can even try SuperHiRes
  5. ;(SHIRES) if you change the appropriate flag in the GameScreen structure.
  6.  
  7.     INCDIR    "INCLUDES:"
  8.     INCLUDE    "games/games_lib.i"
  9.     INCLUDE    "games/games.i"
  10.  
  11. CALL    MACRO
  12.     jsr    _LVO\1(a6)
  13.     ENDM
  14.  
  15.     SECTION    "HiResLaced",CODE
  16.  
  17. ;===========================================================================;
  18. ;                             INITIALISE DEMO
  19. ;===========================================================================;
  20.  
  21.     STARTGMS
  22.  
  23. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  24.     move.l    GMSBase(pc),a6
  25.     lea    ScreenTags(pc),a0
  26.     CALL    AddScreen
  27.     tst.l    d0
  28.     beq.s    .Error_Screen
  29.  
  30.     move.l    Screen(pc),a0
  31.     lea    PictureTags(pc),a1
  32.     move.l    GS_MemPtr1(a0),PicData
  33.     CALL    LoadPic
  34.     tst.l    d0
  35.     beq.s    .Error_Picture
  36.  
  37.     move.l    Picture(pc),a1
  38.     move.l    PIC_Palette(a1),GS_Palette(a0)
  39.     CALL    UpdatePalette
  40.  
  41.     CALL    ShowScreen
  42.  
  43.     bsr.s    Main
  44.  
  45. .ReturnToDOS
  46.     move.l    GMSBase(pc),a6
  47.     move.l    Picture(pc),a1
  48.     CALL    FreePic
  49. .Error_Picture
  50.     move.l    GMSBase(pc),a6
  51.     move.l    Screen(pc),a0
  52.     CALL    DeleteScreen
  53. .Error_Screen
  54.     MOVEM.L    (SP)+,A0-A6/D1-D7
  55.     moveq    #ERR_OK,d0
  56.     rts
  57.  
  58. ;===========================================================================;
  59. ;                                MAIN LOOP
  60. ;===========================================================================;
  61.  
  62. Main:    CALL    WaitVBL
  63.     moveq    #JPORT1,d0
  64.     CALL    ReadMouse
  65.     btst    #MB_LMB,d0
  66.     beq.s    Main
  67.     rts
  68.  
  69. ;===========================================================================;
  70. ;                                  DATA
  71. ;===========================================================================;
  72.  
  73. ScreenTags:
  74.     dc.l    TAGS_GAMESCREEN
  75. Screen:    dc.l    0
  76.     dc.l    GSA_AmtColours,16
  77.     dc.l    GSA_ScrWidth,640
  78.     dc.l    GSA_ScrHeight,256
  79.     dc.l    GSA_Attrib,CENTRE
  80.     dc.l    GSA_ScrMode,HIRES|LACED
  81.     dc.l    TAGEND
  82.  
  83. PictureTags:
  84.     dc.l    TAGS_PICTURE
  85. Picture    dc.l    0
  86.     dc.l    PCA_Data
  87. PicData    dc.l    0
  88.     dc.l    PCA_Width,640
  89.     dc.l    PCA_Height,256
  90.     dc.l    PCA_AmtColours,16
  91.     dc.l    PCA_Options,GETPALETTE
  92.     dc.l    PCA_File,.file
  93.     dc.l    TAGEND
  94.  
  95. .file    dc.b    "GMS:demos/data/PIC.Pic640x256",0
  96.     even
  97.